<template>
    <van-tabs v-model:active="active">
        <van-tab v-for="item in list" :title="item.text" :key="item.id">
        </van-tab>
    </van-tabs>
</template>

<script lang="ts" setup>
import {  ref,defineProps } from 'vue';
import axios from 'axios';
const active = ref<number>(0)
interface INavItem {
  id: string
  text: string
}
const list = ref<INavItem[]>([])
axios({
  url: '/navList',
  method: 'get'
}).then(res => {
  list.value =res.data.result
})

defineProps(
  {
    num:{
      type: Number,
    },
  }
)
const emit = defineEmits(['update:num'])
setTimeout(()=>{
  emit('update:num',2)
},1000)

</script>
